<?php
namespace app\api\controller;

//RPC Server
//non-WSDL 模式
class Testsoapserver
{
    protected $noNeedLogin = ['*'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    //http://ela.test/api/testsoapserver/info?moduleid=kfj
    public function info($moduleid = '')
    {
        $iteminfo = [];
        $iteminfo[] = array(
            "value" => "1---" . $moduleid,
            "num" => 1,
        );
        $iteminfo[] = array(
            "value" => "2---" . $moduleid,
            "num" => 2,
        );
        $iteminfo[] = array(
            "value" => "3---" . $moduleid,
            "num" => 3,
        );

        return $iteminfo;
    }

    public function info2($moduleid = '')
    {
        return $moduleid."-qdqw";
    }

}

$server = new \SoapServer(null, array('uri' => "abcd"));
$server->setClass("\app\api\controller\Testsoapserver");
$server->handle();


